<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout">
<head>
    <title>Owner Information</title>
    <link rel="stylesheet" href="../../static/css/bootstrap.min.css"/>
</head>
<body>

<div class="container">

    <!-- sample header -->
    <nav class="navbar navbar-default navbar-inverse" role="navigation">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">Static Brand</a>
        </div>

        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="employeeList.html">Link1</a></li>
                <li><a href="#">Link2</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">Link3</a></li>
            </ul>
        </div>
    </nav>
    <!-- sample header end -->

    <h1 layout:fragment="header">Owner Information</h1>

    <div layout:fragment="content">

        <!--/*@thymesVar id="owner" type="cn.wilmar.petclinic.model.Owner"*/-->

        <!--        <dl class="dl-horizontal">
                    <dt>Name</dt>
                    <dd id="id" th:text="${owner.id}">123</dd>
                    <dt>Name</dt>
                    <dd id="name" th:text="${owner.firstName + ' ' + owner.lastName}">yinguowei</dd>
                    <dt>Address</dt>
                    <dd id="phone" th:text="${owner.address}">Sdfdsa Rd. 2021 Lane.</dd>
                    <dt>City</dt>
                    <dd id="city" th:text="${owner.city}">Shanghai</dd>
                    <dt>Telephone</dt>
                    <dd id="telephone" th:text="${owner.telephone}">13800000000</dd>
                </dl>-->
        <table class="table table-striped" style="width:600px;">
            <tr>
                <th>Name</th>
                <td><b th:text="|${owner.firstName} ${owner.lastName}|">yinguowei</b></td>
            </tr>
            <tr>
                <th>Address</th>
                <td th:text="${owner.address}">Sdfdsa Rd. 2021 Lane.</td>
            </tr>
            <tr>
                <th>City</th>
                <td th:text="${owner.city}">Shanghai</td>
            </tr>
            <tr>
                <th>Telephone</th>
                <td th:text="${owner.telephone}">13800000000</td>
            </tr>
        </table>

        <a href="createOrUpdateOwnerForm.html" th:href="@{|${owner.id}/edit.html|}" class="btn btn-default">
            Edit Owner</a>

        <a href="../pets/createOrUpdatePetForm.html" th:href="@{|${owner.id}/pets/new.html|}" class="btn btn-default">
            Add New Pet</a>

        <br/>
        <br/>
        <br/>

        <h2>Pets and Visits</h2>

        <table class="table table-striped">

            <tr th:each="pet : ${owner.pets}">
                <td valign="top">
                    <dl class="dl-horizontal">
                        <dt>Name</dt>
                        <dd th:text="${pet.name}">Max Bay</dd>
                        <dt>Birth Date</dt>
                        <dd th:text="${#dates.format(pet.birthDate, 'yyyy-MM-dd')}">2009-01-02</dd><!--.toDate()-->
                            <!--  <joda:format value="${pet.birthDate}" pattern="yyyy-MM-dd"/>-->
                        <dt>Type</dt>
                        <dd th:text="${pet.type.name}">Cat</dd>
                    </dl>
                </td>
                <td valign="top">
                    <table class="table-condensed">
                        <thead>
                        <tr>
                            <th>Visit Date</th>
                            <th>Description</th>
                        </tr>
                        </thead>
                        <tr th:each="visit : ${pet.visits}">
                            <td th:text="${#dates.format(visit.date, 'yyyy-MM-dd')}">2000-1-1</td><!--.toDate()-->
                            <td th:text="${visit.description}">OK</td>
                        </tr>
                        <tr>
                            <td>
                                <a href="../pets/createOrUpdatePetForm.html"
                                   th:href="@{|/owners/${owner.id}/pets/${pet.id}/edit|}">Edit Pet</a>
                            </td>
                            <td>
                                <a href="../pets/createOrUpdateVisitForm.html"
                                   th:href="@{|/owners/${owner.id}/pets/${pet.id}/visits/new|}">Add Visit</a>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>

        </table>

    </div>


    <div class="text-center">
        sample copyright 2016
    </div>
</div>
</body>
</html>

